Jquery [name=var] substitution

Posted by Ian on Stack Overflow See other posts from Stack Overflow or by Ian
Published on 2010-06-09T00:28:26Z Indexed on 2010/06/09 0:32 UTC
Read the original article Hit count: 168

Filed under:

Is there a way to use a variable in the name= parameter.

I would like to be able to do:

var a = 1;

$("#gen_p").html($("input:radio[name='gen'+a]:checked").val()));

I am able to do $("#gen_p"+a) but not in the [name=??]

Have I missed something?

Thanks

© Stack Overflow or respective owner

Related posts about jQuery